FROM maven:3.6-openjdk-8

USER root

# 挂载目录
VOLUME /java/
# 创建目录
RUN mkdir -p /java/
# RUN mkdir -p /java/jar
# 指定路径
WORKDIR /java/

COPY . .

# CMD mvn package && cp -r ruoyi-admin/target/ruoyi-admin.jar jar/ && java -jar ruoyi-admin/target/ruoyi-admin.jar
# CMD mvn package && cp -r ruoyi-admin/target/ruoyi-admin.jar jar/ && java -jar jar/ruoyi-admin.jar

RUN mvn package

RUN cp -r ruoyi-admin/target/ruoyi-admin.jar .

# RUN java -jar ruoyi-admin.jar
ENTRYPOINT ["java","-jar","ruoyi-admin.jar"]

EXPOSE 8080

# CMD mvn package && cp -r ruoyi-admin/target/ruoyi-admin.jar jar/ && java -jar jar/ruoyi-admin.jar